package com.oceansoft.mobile.biz.api.controller;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import com.alibaba.fastjson.JSON;
import com.oceansoft.mobile.biz.api.service.ISendMessage;
import com.oceansoft.mobile.biz.api.service.SendMessage;
import com.oceansoft.mobile.weixin.util.WeixinUtil;

import org.apache.commons.codec.binary.Base64;
import org.apache.commons.fileupload.disk.DiskFileItem;
//import org.codehaus.xfire.client.XFireProxyFactory;
//import org.codehaus.xfire.service.Service;
//import org.codehaus.xfire.service.binding.ObjectServiceFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import sun.misc.BASE64Encoder;

import com.alibaba.fastjson.JSONObject;
import com.oceansoft.mobile.biz.api.entity.Member;
import com.oceansoft.mobile.common.Constant;
import com.oceansoft.mobile.common.util.HttpClientUtil;
import com.oceansoft.mobile.common.util.Result;
import com.oceansoft.mobile.weixin.util.RequestUtils;

@Controller
@RequestMapping("api/applyMatters")
public class ApiApplyMattersController {
  
	// private static final String host="http://221.224.13.5:8190/econsole";
//private static final String host = "http://localhost:8080/econsole";
	public static String getcase =Constant.host5+"/api/getcase/GetDetail";



	//短信接口
	public static final String URL_ADDRESS = "http://172.16.1.236:8084/smsplat/services/smsService";
	public static final String message="您在苏州公安微警务中申请办理的户口业务已成功受理，公安机关将对您提交的材料进行审核并反馈审核结果。";

	@RequestMapping(value = "gotopage/{pageName}")
	public String gotoMattersPage(@PathVariable("pageName") String pageName,HttpSession session,HttpServletRequest request,Model model) {
		if("hkzxbl0".equals(pageName)){
			request.getSession().setAttribute("hkyslid",request.getParameter("caseid"));
		}
//		String s = (String)request.getSession().getAttribute("hkysl");
		//施工和货车申报需要用到用户userId（已登录）
		String source = (String) request.getSession().getAttribute("source");
	       if (!StringUtils.isEmpty(source)) {
	       	model.addAttribute("source", source);
	       }
		if(pageName.contains("hclstxz")||pageName.contains("sgcltxz")){
			Member member = (Member)session.getAttribute(Constant.SESSION_USER);
			if(null!=member){
				model.addAttribute("userId",member.getGuid());
				model.addAttribute("xzfy",request.getSession().getAttribute("xzfy"));
				 
				
			}

		}

		return "weixin/matters/" + pageName;
	}
	/**
	 * 新增一个需要登录的跳转控制
	 *
	 * @return
	 */
	@RequestMapping(value = "gotopageWithUser/{pageName}")
	public String gotoMattersPageWithUser(@PathVariable("pageName") String pageName,HttpServletRequest request,Model model) throws IllegalArgumentException, IOException {
		boolean b = WeixinUtil.checkIsLoginUser(request);
		String source = (String) request.getSession().getAttribute("source");
		 if (!StringUtils.isEmpty(source)) {
		       	model.addAttribute("source", source);
		       }
//        b=true;
		if(!b){
			model.addAttribute("openId", (String) request.getSession().getAttribute("openId"));
			model.addAttribute("gotoPage","/api/applyMatters/gotopageWithUser/"+pageName);
			return "weixin/login/login";
		}else{			
			Member member = (Member)request.getSession().getAttribute(Constant.SESSION_USER);
			model.addAttribute("data",member);

		return "weixin/matters/" + pageName;
		}
	}


	/**
	 * 利用道路、公共广场等设置停车泊位的审批
	 * 
	 * @param sqr
	 * @param sqrAddr
	 * @param fzr
	 * @param fzrPhone
	 * @param tcclb
	 * @param tccmc
	 * @param tccmj
	 * @param tccdz
	 * @param tccbws
	 * @param tccglrys
	 * @param sqly
	 * @param createUserId
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "applyCarSpace", method = RequestMethod.POST)
	public Result submitCarSpace(@RequestParam("sqr") String sqr,
			@RequestParam("sqrAddr") String sqrAddr,
			@RequestParam("fzr") String fzr,
			@RequestParam("fzrPhone") String fzrPhone,
			@RequestParam("tcclb") String tcclb,
			@RequestParam("tccmc") String tccmc,
			@RequestParam("tccmj") String tccmj,
			@RequestParam("tccdz") String tccdz,
			@RequestParam("tccbws") String tccbws,
			@RequestParam("tccglrys") String tccglrys,
			@RequestParam("sqly") String sqly,
			@RequestParam("declareCaseGuid") String declareCaseGuid,
			HttpServletRequest request) {

		JSONObject param = RequestUtils.buildParamsByNamesFromRequest4JSON(request);
		//需要用到userguid
		Member m = (Member)request.getSession().getAttribute(Constant.SESSION_USER);
		param.put("CREATEUSERID", m.getGuid());
		Result s = RequestUtils.saveSpecific(param, "api/PakingLot/lydl");
		Result result = RequestUtils.submitShenbao4request(request, s.getData().toString(), "", true);
		
		return result;
	}
	
	/**
	 * 影响交通安全的道路挖掘、占用或跨越、穿越道路架设、埋设管线设施许可------基本信息
//	 * @param sqr
//	 * @param sqrdw
//	 * @param xcfzr
//	 * @param zwdd
//	 * @param zwmj
//	 * @param zwStratTime
//	 * @param zwEndTime
//	 * @param sqly
//	 * @param createUserId
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value="applyWd",method= RequestMethod.POST)
	public Result submitWd(HttpServletRequest request){
		JSONObject param = RequestUtils.buildParamsByNamesFromRequest4JSON(request);
		//需要用到userguid
		Member m = (Member)request.getSession().getAttribute(Constant.SESSION_USER);
		param.put("CREATEUSERID", m.getGuid());
		Result s = RequestUtils.saveSpecific(param, "api/PakingLot/yxdl");
		Result result = RequestUtils.submitShenbao4request(request, s.getData().toString(), "", true);
		return result;
	}
	
	
	
	/**
	 * 家属网上预约1
	 * @param base64
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value="appointPerson",method=RequestMethod.POST)
	public Result submitAppointPerson(
			@RequestParam("base641")String base641,
			//@RequestParam("base642")String base642,
			@RequestParam("declareCaseGuid") String declareCaseGuid,
			@RequestParam("AliasName") String AliasName,
			@RequestParam("UserCode") String UserCode,
			@RequestParam("Address") String Address,
			@RequestParam("LinkName") String LinkName,
			@RequestParam("Mobile") String Mobile,
			HttpServletRequest request){
//		JSONObject param = RequestUtils.buildParamsByNamesFromRequest4JSON(request);
		//上传附件
		/*Result fj1 = RequestUtils.saveFj(request, base641, "1870387b-67ae-4a1f-aa35-2302d62db12e", true);
		//关联附件
		Result fj2 = RequestUtils.saveFj(request, base642, "6c7fe93f-dccd-4f02-8c6f-986574422acc", true);
		//关联附件
		Map<String ,Result> m = new HashMap<String ,Result>();
		m.put("fj1", fj1);
		m.put("fj2", fj2);
		request.getSession().setAttribute("yy_1", m);
		//上报
		Result result = RequestUtils.submitShenbao4request(request, "", "yy_1", true);
		return result;*/
		
		Map<String, String> param = new HashMap<String, String>();
		param = RequestUtils.buildParamsByNamesFromRequest(request);
		request.getSession().setAttribute("wsyy", param);
		Result r=new Result();
		return r;
	}

	/**
	 *  家属网上预约2
//	 * @param base641
	 * @param base642
	 * @param request
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value="appointPerson2",method=RequestMethod.POST)
	public Result submitAppointPerson2(
			@RequestParam("base642")String base642,
			HttpServletRequest request){
		
		Map<String, String> param = (Map<String, String>)request.getSession().getAttribute("wsyy");
		
//		JSONObject param = RequestUtils.buildParamsByNamesFromRequest4JSON(request);
		//上传附件
		Result fj1 = RequestUtils.saveFj(request, param.get("base641"), "1870387b-67ae-4a1f-aa35-2302d62db12e", true);
		//关联附件
		Result fj2 = RequestUtils.saveFj(request, base642, "6c7fe93f-dccd-4f02-8c6f-986574422acc", true);
		//关联附件
		Map<String ,Result> m = new HashMap<String ,Result>();
		m.put("fj1", fj1);
		m.put("fj2", fj2);
		request.getSession().setAttribute("yy_1", m);
		//上报
		Result result = RequestUtils.submitShenbao4request(request, "", "yy_1", true);
		return result;
		
	}
	
	/**
	 * 家属申请网上视频会见在押人员
	 */
	@ResponseBody
	@RequestMapping(value="appointPerson1",method=RequestMethod.POST)
	public Result submitAppointPerson1(
			@RequestParam("base64")String base64,
			@RequestParam("type")String type,
			@RequestParam("declareCaseGuid") String declareCaseGuid,
			@RequestParam("AliasName") String AliasName,
			@RequestParam("UserCode") String UserCode,
			@RequestParam("Address") String Address,
			@RequestParam("LinkName") String LinkName,
			@RequestParam("Mobile") String Mobile,
			@RequestParam("caseMatGuid") String caseMatGuid,
			HttpServletRequest request){
	JSONObject param = RequestUtils.buildParamsByNamesFromRequest4JSON(request);
	//上传附件
	Result fj = RequestUtils.saveFj(request, base64, param.getString("caseMatGuid"), true);
	//关联附件
	Map<String ,Result> m = new HashMap<String ,Result>();
	m.put("fj1", fj);
	request.getSession().setAttribute("yy_2", m);
	//上报
	Result result = RequestUtils.submitShenbao4request(request, "", "yy_2", true);
	return result;
	}
	
	/**
	 * 网上预约参观监管所
	 */
	@ResponseBody
	@RequestMapping(value="appointPerson3",method=RequestMethod.POST)
	public Result submitAppointPerson3(
			@RequestParam("base64")String base64,
			@RequestParam("type")String type,
			@RequestParam("declareCaseGuid") String declareCaseGuid,
			@RequestParam("AliasName") String AliasName,
			@RequestParam("UserCode") String UserCode,
			@RequestParam("Address") String Address,
			@RequestParam("LinkName") String LinkName,
			@RequestParam("Mobile") String Mobile,
			@RequestParam("caseMatGuid") String caseMatGuid,
			HttpServletRequest request){
	JSONObject param = RequestUtils.buildParamsByNamesFromRequest4JSON(request);
	//上传附件
	Result fj = RequestUtils.saveFj(request, base64, param.getString("caseMatGuid"), true);
	//关联附件
	Map<String ,Result> m = new HashMap<String ,Result>();
	m.put("fj1", fj);
	request.getSession().setAttribute("yy_2", m);
	//上报
	Result result = RequestUtils.submitShenbao4request(request, "", "yy_2", true);
	return result;
	}
	/**
	 *申请门牌号码图片上传
//	 * @param base64
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value="uploadMsgMPHM",method=RequestMethod.POST)
	public Result uploadMsgMPHM(@RequestParam("type")String type,MultipartHttpServletRequest request){
		String caseMatGuid = type;
		//type字段用于识别前台传过来的不同图片
		//type_1 
		//Result result = uploadFJ(type, request, "pzctrl",type);
		Result result = RequestUtils.saveFj(request, "pzctrl", caseMatGuid, false);
		Map<String ,Result> m = (Map<String ,Result>)request.getSession().getAttribute("mphm_fj");
		request.getSession().removeAttribute("mphm_fj");
		if(null==m)
		{
			m = new HashMap<String ,Result>();
		}
		m.put("mphm_fj"+type, result);
		request.getSession().setAttribute("mphm_fj", m);
		//System.out.println("门牌号码的附件包含"+m.toString());
		return result;
	}

	
	/**
	 * 申请门牌号码1
	 */
	@ResponseBody
	@RequestMapping(value="applySqmphm1",method= RequestMethod.POST)
	public Result applySqmphm1(HttpServletRequest request,@RequestParam("depart2") String depart2){
		Map<String, String> param = new HashMap<String, String>();
		param = RequestUtils.buildParamsByNamesFromRequest(request);
		param.put("orgId", depart2);
		param.put("caseName", "门牌号码");
		request.getSession().setAttribute("mphm", param);
		///Result r = JSONObject.parseObject(HttpClientUtil.doPost(url, param, "utf-8"), Result.class);
		///System.out.println(r);
		return new Result();
	}

    private Result jsonObject2Result(JSONObject jsonObject){
        Result result = new Result(jsonObject);
        return result;
    }
	/**
	 * 申请门牌号码2
	 */
	@RequestMapping(value="applySqmphm2",method= RequestMethod.GET)
	public String applySqmphm2(HttpServletRequest request,Model model){
		//获取选择的派出所对应的事项和材料
//		String url = Constant.host + "/api/matters/getcase/getCaseInfo";
		String url = Constant.host5 + "/api/getcase/GetDetail";
		Map<String, String> param = (Map<String, String>)request.getSession().getAttribute("mphm");

		Result r = JSONObject.parseObject(HttpClientUtil.doPost(url, param, "utf-8"), Result.class);
		if(r==null||r.getData()==null||((JSONObject)r.getData()).get("baseInfo")==null)
		{
			return "weixin/matters/sqmphmNo";
		}
		
		//获取材料guid
		String REFGUID = ((JSONObject)((JSONObject)r.getData()).get("baseInfo")).getString("REFGUID");
//		url = Constant.host + "/api/matters/getcase/getCaseMaterial";
		url = Constant.host5 + "/api/getcase/GetCaseMaterial?refID="+REFGUID;
		param.put("refid", REFGUID);
		if(StringUtils.hasText(REFGUID)){
            try{
                Result rr = jsonObject2Result(JSONObject.parseObject(HttpClientUtil.doGet(url)));
                model.addAttribute("cl", rr);//材料list
            }catch (Exception e){
                e.printStackTrace();
            }
			
		}
		else
		{
			return "weixin/matters/sqmphmNo";
		}
		 String source = (String) request.getSession().getAttribute("source");
	       if (!StringUtils.isEmpty(source)) {
	       	model.addAttribute("source", source);
	       }
		model.addAttribute("res", r);
		return "weixin/matters/sqmphm";
	}
	
	/**
	 * 申请门牌号码3
	 */
	@ResponseBody
	@RequestMapping(value="applySqmphmMsg",method= RequestMethod.POST)
	public Result submitSqmphmMsg(HttpServletRequest request,@RequestParam("declareCaseGuid") String declareCaseGuid){
		Map<String, String> param = (Map<String, String>)request.getSession().getAttribute("mphm");
		Result result = RequestUtils.submitShenbao(RequestUtils.map2Json(param),request, "", "mphm_fj", true);
		request.getSession().removeAttribute("mphm");
		return result;
	}
	
	/**
	 * 行政复议1
	 */
	@ResponseBody
	@RequestMapping(value="applyXzfy",method= RequestMethod.POST)
	public Result applyXzfy(HttpServletRequest request,@RequestParam("isunit") String isunit,
			@RequestParam("applicantname") String applicantname,
			@RequestParam("applicantsex") String applicantsex,
			@RequestParam("applicantidcar") String applicantidcar,
			@RequestParam("applicanttel") String applicanttel,
			@RequestParam("unitpersonname") String unitpersonname,
			@RequestParam("applicantunit") String applicantunit,
			@RequestParam("applicantaddress") String applicantaddress,
			@RequestParam("clientname") String clientname,
			@RequestParam("requestmemo") String requestmemo,
			@RequestParam("clientlegalentity") String clientlegalentity,
			@RequestParam("delegatename") String delegatename,
			@RequestParam("factmemo") String factmemo){
		//String url = Constant.host + "/api/matters/pakingLot/yxdl";
		Map<String, String> param = new HashMap<String, String>();
		param = RequestUtils.buildParamsByNamesFromRequest(request);
		request.getSession().setAttribute("xzfy", param);
		Result r=new Result();
		return r;
	}
	
	/**
	 *行政复议图片上传2
//	 * @param base64
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value="uploadMsg",method=RequestMethod.POST)
	public Result uploadMsg(HttpServletRequest request){
		//type字段用于识别前台传过来的不同图片
		//type_1 
		String caseMatGuid=request.getParameter("type");
		String seesionname = request.getParameter("imgname");
		String base64 = request.getParameter("base64");
		String name=request.getParameter("name");
		Result result =  new Result();
		try{
			result=	RequestUtils.saveFj(request,base64, caseMatGuid, true);
			System.out.println(result.toString());
		}catch(Exception e){
			e.printStackTrace();
		}
		Map<String ,Result> m = (Map<String ,Result>)request.getSession().getAttribute(name);
		request.getSession().removeAttribute(name);
		if(null==m)
		{
			m = new HashMap<String ,Result>();
		}
		//m.put("xzfy_fj"+type, result);
		m.put(seesionname, result);
		request.getSession().setAttribute(name,m);
		return result;
	}
	
	
	
	/**
	 * 行政复议3
	 */
	@ResponseBody
	@RequestMapping(value="applyXzfyMsg",method= RequestMethod.POST)
	public Result submitXZFY(HttpServletRequest request){
		String url = "api/OnlineReport/SetXzfyReport";
		Map<String, String> param = (Map<String, String>)request.getSession().getAttribute("xzfy");
		Result r =  RequestUtils.saveSpecific(RequestUtils.map2Json(param), url);
		Result result = RequestUtils.submitShenbao(RequestUtils.map2Json(param),request, (String)r.getData(), "xzfy_fj", true);
		request.getSession().removeAttribute("xzfy");
		return result;
	}

	
	
	/**
	 * 获取全部苏州市局及分局信息
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value="depart/szsj",method=RequestMethod.GET)
	public Result getSZSJDepart(){
//		String url = Constant.host + "/api/matters/depart/szsj";
		String url = Constant.host5 + "/api/police/Police_Bureaus";
		Result result=null;
		try {
			String res = HttpClientUtil.doGet(url);
			result = JSONObject.parseObject(res, Result.class);
			//System.out.println(res);
		} catch (IllegalArgumentException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		return result; 
	}
	
	/**
	 * 获取全部苏州派出所及分局信息
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value="depart/szsj/pcs",method=RequestMethod.GET)
	public Result getSZSJDepartPCS(@RequestParam("orgid") String orgid){
//		String url = Constant.host + "/api/matters/depart/szsj/pcs?orgid="+orgid;
		String url =Constant.host5+("api/police/police_stations?guid="+orgid);
//		 if (super.exists(url)) {
//	            return new Result(Result.SUCC, super.getObject(url));
//	     }
		Result result=null;
		try {
			result = JSONObject.parseObject(HttpClientUtil.doGet(url), Result.class);
		} catch (IllegalArgumentException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return result;
	}
	
	
	@ResponseBody
	 @RequestMapping(value="getCaseInfo",method= RequestMethod.POST)
	 public Result getCaseInfo(@RequestParam("orgId") String orgId,
							   @RequestParam("caseName") String caseName){
//		String url = Constant.host + "/api/matters/getcase/getCaseInfo";
        String url = Constant.host5 + "/api/getcase/GetDetail";
		Map<String, String> param = new HashMap<String, String>();
		param.put("orgId", orgId);
		param.put("caseName", caseName);
		Result result = JSONObject.parseObject(HttpClientUtil.doPost(url, param, "utf-8"), Result.class);
		return result;
	}
	/**
	 * 公用：获取事项对应的事项详情
	 * @return result
	 */
	@ResponseBody
	@RequestMapping(value="detail")
	public Result getdetail(HttpServletRequest request) throws IllegalArgumentException, IOException
	{
		Result result =new Result();
		Map<String, String> param = new HashMap<String, String>();
		String type=request.getParameter("type");
//		param.put("refid","faaffd48-65d0-41c1-9192-d946bd92ee34");//施工
//		param.put("orgId","F1DBDF352FC94EA28A020559048718A7");
		param.put("refid",request.getParameter("refid"));//施工
		param.put("orgId",request.getParameter("orgId"));
		String resp = HttpClientUtil.doPost(getcase, param, "utf-8");
		if (com.oceansoft.mobile.common.util.StringUtils.isNotBlank(resp)) {
			JSONObject respData = JSON.parseObject(resp);
			boolean succ = "true".equalsIgnoreCase(respData.getString("succ"));
			if(succ){
				JSONObject data = new JSONObject();
				data =JSONObject.parseObject(respData.get("data").toString());
				result = new Result(data.get("baseInfo"));
			}
		}
		return result;
	}
	

	 @RequestMapping(value = "gotoPageByUserAll/{state}", method = RequestMethod.GET)
	    public String gotoPages(@PathVariable("state") String state,
	                            HttpServletRequest request, Model model, HttpSession session) {
	        model.addAttribute("openId", (String) request.getSession().getAttribute("openId"));
	        model.addAttribute("state", state);
	        String url =  Constant.stateMap.get(state);
	        if(StringUtils.isEmpty(url))
	        {
	        	url =  Constant.stateMap.get("0");
	        }
	        model.addAttribute("url",url);
	        Member member = (Member) session.getAttribute(Constant.SESSION_USER);
	        model.addAttribute("data", member);
	        String source = (String) request.getSession().getAttribute("source");
	        if (!StringUtils.isEmpty(source)) {
	        	//model.addAttribute("source", source);
	        	if(url.indexOf("?")>=0)
	        	{
	        		url+="&source="+source;
	        	}
	        	else
	        	{
	        		url+="?source="+source;
	        	}
	        	
	        }
//	        String openId=(String) request.getSession().getAttribute("openId");
//	        if (StringUtils.isEmpty(openId)){
//	        	return "redirect:";
//	        }else{
//	        	return "";
//	        }
	        return "redirect:"+url;
	        
	    }
	
	 @ResponseBody
	 @RequestMapping(value="uploadfiles",method=RequestMethod.POST)
	 public Result uploadMsg(@RequestParam("caseMatGuid")String caseMatGuid,@RequestParam("type")String type,MultipartHttpServletRequest request){
		System.out.println("caseMatGuid===="+caseMatGuid);
		 Result result = RequestUtils.saveFj(request, "pzctrl", caseMatGuid, false);
		Map<String ,Result> m = (Map<String ,Result>)request.getSession().getAttribute(type);
		if(null==m)
		{
			m = new HashMap<String ,Result>();
		}
		m.put(type+"_"+caseMatGuid, result);
		request.getSession().setAttribute(type, m);
		return result;
	 }
	 @ResponseBody
	 @RequestMapping(value="applyhkysl",method= RequestMethod.POST)
	 public Result submitPreExecute(@RequestParam("type")String type,HttpServletRequest request,@RequestParam("declareCaseGuid") String declareCaseGuid){
		Result result = RequestUtils.submitShenbao(new JSONObject(),request, "", type, true);
		 if(request.getParameter("issl").equals("0")){
			 //申报成功后发送短信
			 if(result.isSucc()==true){
				 Member user = (Member) request.getSession().getAttribute(Constant.SESSION_USER);
				 String tel=user.getMobile();
				 SendMessage sendMessage=new SendMessage(tel);
				 sendMessage.run();
			 }
		 }
//		 request.getSession().removeAttribute("hkysl");
		return result;
	 }
	 @ResponseBody
	 @RequestMapping("resetfiles/{type}")
	 public Result resetfiles(@PathVariable("type")String type,HttpSession session){
		 session.removeAttribute(type);
		 return new Result("清理附件");
	 }
	@RequestMapping(value="yjPage",method= RequestMethod.GET)
	public String yjPage(HttpServletRequest request,Model model){
		Member user = (Member) request.getSession().getAttribute(Constant.SESSION_USER);
		model.addAttribute("declareCaseGuid",request.getParameter("declareCaseGuid"));
		model.addAttribute("source",request.getParameter("source"));
		model.addAttribute("member",user);
		return "weixin/matters/jd";
	}
}
